package org.learn.intermediate.homework01;

import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;

public class HomeWork05 {
    public static void main(String[] args) throws IOException {
        String filePath = "d:\\mytemp\\hello.txt";
        BufferedReader br = null;
        String line = "";
         int LineNum = 0;
        try {
            br = new BufferedReader(new FileReader(filePath));
           while ((line = br.readLine())!= null) {
               System.out.println(++LineNum + line);
           }
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
              if(br != null){
                  br.close();
              }
        }


    }
}
